#include "msp430x41x.h"
char *LCD = LCDMEM;
void Disp_Num(unsigned char pos, unsigned char num);

void Display(long count)
{
    unsigned char digit_one=0;
    unsigned char digit_two=0;
    unsigned char digit_three=0;
    unsigned char digit_four=0;
    unsigned char digit_five=0;
    
    digit_one=count%10;
    digit_two=(count%100)/10;
    digit_three=(count%1000)/100;
    digit_four=(count%10000)/1000;
    digit_five=count/10000;
    
    Disp_Num(5,digit_one);
    Disp_Num(4,digit_two);
    Disp_Num(3,digit_three);
    Disp_Num(2,digit_four);
    Disp_Num(1,digit_five);

}

void Disp_Num(unsigned char pos, unsigned char num)
{
    if(num==0)
    {
    LCD[(pos-1)*2+1]=0x33;
    LCD[(pos-1)*2]=0x12;    
    }

    if(num==1)
    {
    LCD[(pos-1)*2+1]=0x11;
    LCD[(pos-1)*2]=0x00;    
    }

    if(num==2)
    {
    LCD[(pos-1)*2+1]=0x21;
    LCD[(pos-1)*2]=0x13;    
    }

    if(num==3)
    {
    LCD[(pos-1)*2+1]=0x31;
    LCD[(pos-1)*2]=0x11;    
    }
    
    if(num==4)
    {
    LCD[(pos-1)*2+1]=0x13;
    LCD[(pos-1)*2]=0x01;    
    }

    if(num==5)
    {
    LCD[(pos-1)*2+1]=0x32;
    LCD[(pos-1)*2]=0x11;    
    }

    if(num==6)
    {
    LCD[(pos-1)*2+1]=0x32;
    LCD[(pos-1)*2]=0x13;    
    }

    if(num==7)
    {
    LCD[(pos-1)*2+1]=0x11;
    LCD[(pos-1)*2]=0x10;    
    }

    if(num==8)
    {
    LCD[(pos-1)*2+1]=0x33;
    LCD[(pos-1)*2]=0x13;    
    }

    if(num==9)
    {
    LCD[(pos-1)*2+1]=0x33;
    LCD[(pos-1)*2]=0x11;    
    }    

} 


  
  
  
void Disp_Clear(void)
{
  LCD[0]=0;
  LCD[1]=0;
  LCD[2]=0;
  LCD[3]=0;
  LCD[4]=0;
  LCD[5]=0;
  LCD[6]=0;
  LCD[7]=0;
  LCD[8]=0;
  LCD[9]=0;
  LCD[10]=0;
}
  
  
  
  
  
  
/*  
  if(fish_count_hundred==0)
  {
  LCD[0]=0xff;
  LCD[1]|=0x0f;
  LCD[6]=0xff;
  LCD[7]|=0x0f;
  }
  
  if(fish_count_hundred==1)
  {
  LCD[1]|=0x0f;
  LCD[7]|=0x0f;
  }  

  if(fish_count_hundred==2)
  {
  LCD[0]=0xff;
  LCD[5]|=0xf0;
  LCD[6]=0xf0;
  LCD[7]|=0x0f;
  } 
  
  if(fish_count_hundred==3)
  {
  LCD[0]=0xf0;
  LCD[1]|=0x0f;  
  LCD[5]|=0xf0;
  LCD[6]=0xf0;
  LCD[7]|=0x0f;
  }   

  if(fish_count_hundred==4)
  {
  LCD[1]|=0x0f;  
  LCD[5]|=0xf0;
  LCD[6]=0x0f;
  LCD[7]|=0x0f;
  }   

  if(fish_count_hundred==5)
  {
  LCD[0]=0xf0;     
  LCD[1]|=0x0f;  
  LCD[5]|=0xf0;
  LCD[6]=0xff;
  }    

  if(fish_count_hundred==6)
  {
  LCD[0]=0xff;     
  LCD[1]|=0x0f;  
  LCD[5]|=0xf0;
  LCD[6]=0xff;
  }   

  if(fish_count_hundred==7)
  {  
  LCD[1]|=0x0f;  
  LCD[6]=0xf0;
  LCD[7]|=0x0f;
  }   

  if(fish_count_hundred==8)
  {
  LCD[0]=0xff;     
  LCD[1]|=0x0f;  
  LCD[5]|=0xf0;
  LCD[6]=0xff;
  LCD[7]|=0x0f; 
  }   

  if(fish_count_hundred==9)
  {
  LCD[0]=0xf0;     
  LCD[1]|=0x0f;  
  LCD[5]|=0xf0;
  LCD[6]=0xff;
  LCD[7]|=0x0f; 
  }    

  if(fish_count_ten==0)
  {
  LCD[0+2]=0xff;
  LCD[1+2]|=0x0f;
  LCD[6+2]=0xff;
  LCD[7+2]|=0x0f;
  }
  
  if(fish_count_ten==1)
  {
  LCD[1+2]|=0x0f;
  LCD[7+2]|=0x0f;
  }  

  if(fish_count_ten==2)
  {
  LCD[0+2]=0xff;
  LCD[5+2]|=0xf0;
  LCD[6+2]=0xf0;
  LCD[7+2]|=0x0f;
  } 
  
  if(fish_count_ten==3)
  {
  LCD[0+2]=0xf0;
  LCD[1+2]|=0x0f;  
  LCD[5+2]|=0xf0;
  LCD[6+2]=0xf0;
  LCD[7+2]|=0x0f;
  }   

  if(fish_count_ten==4)
  {
  LCD[1+2]|=0x0f;  
  LCD[5+2]|=0xf0;
  LCD[6+2]=0x0f;
  LCD[7+2]|=0x0f;
  }   

  if(fish_count_ten==5)
  {
  LCD[0+2]=0xf0;     
  LCD[1+2]|=0x0f;  
  LCD[5+2]|=0xf0;
  LCD[6+2]=0xff;
  }    

  if(fish_count_ten==6)
  {
  LCD[0+2]=0xff;     
  LCD[1+2]|=0x0f;  
  LCD[5+2]|=0xf0;
  LCD[6+2]=0xff;
  }   

  if(fish_count_ten==7)
  {  
  LCD[1+2]|=0x0f;  
  LCD[6+2]=0xf0;
  LCD[7+2]|=0x0f;
  }   

  if(fish_count_ten==8)
  {
  LCD[0+2]=0xff;     
  LCD[1+2]|=0x0f;  
  LCD[5+2]|=0xf0;
  LCD[6+2]=0xff;
  LCD[7+2]|=0x0f; 
  }   

  if(fish_count_ten==9)
  {
  LCD[0+2]=0xf0;     
  LCD[1+2]|=0x0f;  
  LCD[5+2]|=0xf0;
  LCD[6+2]=0xff;
  LCD[7+2]|=0x0f; 
  }  
  
  if(fish_count_one==0)
  {
  LCD[0+4]=0xff;
  LCD[1+4]|=0x0f;
  LCD[6+4]=0xff;
  LCD[7+4]|=0x0f;
  }
  
  if(fish_count_one==1)
  {
  LCD[1+4]|=0x0f;
  LCD[7+4]|=0x0f;
  }  

  if(fish_count_one==2)
  {
  LCD[0+4]=0xff;
  LCD[5+4]|=0xf0;
  LCD[6+4]=0xf0;
  LCD[7+4]|=0x0f;
  } 
  
  if(fish_count_one==3)
  {
  LCD[0+4]=0xf0;
  LCD[1+4]|=0x0f;  
  LCD[5+4]|=0xf0;
  LCD[6+4]=0xf0;
  LCD[7+4]|=0x0f;
  }   

  if(fish_count_one==4)
  {
  LCD[1+4]|=0x0f;  
  LCD[5+4]|=0xf0;
  LCD[6+4]=0x0f;
  LCD[7+4]|=0x0f;
  }   

  if(fish_count_one==5)
  {
  LCD[0+4]=0xf0;     
  LCD[1+4]|=0x0f;  
  LCD[5+4]|=0xf0;
  LCD[6+4]=0xff;
  }    

  if(fish_count_one==6)
  {
  LCD[0+4]=0xff;     
  LCD[1+4]|=0x0f;  
  LCD[5+4]|=0xf0;
  LCD[6+4]=0xff;
  }   

  if(fish_count_one==7)
  {  
  LCD[1+4]|=0x0f;  
  LCD[6+4]=0xf0;
  LCD[7+4]|=0x0f;
  }   

  if(fish_count_one==8)
  {
  LCD[0+4]=0xff;     
  LCD[1+4]|=0x0f;  
  LCD[5+4]|=0xf0;
  LCD[6+4]=0xff;
  LCD[7+4]|=0x0f; 
  }   

  if(fish_count_one==9)
  {
  LCD[0+4]=0xf0;     
  LCD[1+4]|=0x0f;  
  LCD[5+4]|=0xf0;
  LCD[6+4]=0xff;
  LCD[7+4]|=0x0f; 
  }   
*/







